<?php
/**
 * +--------------------------------------------------------+
 * @Created by Phpstorm.
 * @Category OnlineService.php
 * @Depiction
 * @Author hwy <429208948@qq.com>
 * @Date 2022/5/20  15:18
 * +--------------------------------------------------------+
 */

namespace App\Services\Swoole\Components;

/**
 * Class OnlineService 查询在线人数
 * @package App\Services\Swoole\Components
 */
class OnlineService implements ComponentsInterface
{
    public $ws;
    public $frame;
    public function handle()
    {
        $res_data['count'] = count($this->ws->connections);

        return $res = response_success_msg('请求成功！', $res_data);
    }

}
